import React from 'react'
import {Col, Row,Select,Checkbox} from "antd";

import {WeaLocaleProvider,WeaInput,WeaBrowser, WeaFormItem, WeaInputNumber, WeaSearchGroup, WeaSelect,WeaCheckbox} from "ecCom";


const getLabel = WeaLocaleProvider.getLabel;

export default class AddExtendGroup extends React.Component{

    render(){
        const {setting,setSetting} = this.props
        const {directoryIdsReplaceData,virtualDocumentIdsReplaceData,docIdsReplaceData,directoryIdsSelected,virtualDirectoryIdsSelected,docIdsSelected} = setting

        return (
            <WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@962bp4`}  title={getLabel(20885, '内容来源')} needTigger={true} showGroup={true}>
                <div className="set-items">
                    <div style={{'margin-top':'10px'}}>
                        <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@m7idf7`} >
                            <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@djxv31`} span={6} >
                                <Checkbox ecId={`${this && this.props && this.props.ecId || ''}_Checkbox@4p2guu`}
                                    style={{marginLeft: '0px'}}
                                    checked={directoryIdsSelected}
                                    onChange={e => setSetting({'directoryIdsSelected':e.target.checked})}
                                >{getLabel(16398, '文档目录')} :</Checkbox>
                            </Col>
                            <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@4x1994`} span={18}>
                                <WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@egli1u`}
                                    title={getLabel(386382,"请选择")}
                                    type="doccategory"
                                    replaceDatas={ directoryIdsReplaceData|| []}
                                    isSingle={false}
                                    onChange={(ids, names, datas) => {
                                        setSetting({directoryIdsSelected:true,directoryIds: ids, directoryIdsReplaceData: datas})
                                    }}
                                    layout={document.body}
                                />
                            </Col>
                        </Row>
                    </div>
                    <div style={{'margin-top':'10px'}}>
                        <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@yan35a`} >
                            <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@1i6t3z`} span={6} >
                                <Checkbox ecId={`${this && this.props && this.props.ecId || ''}_Checkbox@w5m1jw`}
                                    style={{marginLeft: '0px'}}
                                    checked={virtualDirectoryIdsSelected}
                                    onChange={e => setSetting({'virtualDirectoryIdsSelected':e.target.checked})}
                                >{getLabel(20482, '虚拟目录')} :</Checkbox>
                            </Col>
                            <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@0h82t1`} span={18}>
                                <WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@7rg22i`}
                                    title={getLabel(386382,"请选择")}
                                    type="docdummy"
                                    replaceDatas={ virtualDocumentIdsReplaceData|| []}
                                    isSingle={false}
                                    onChange={(ids, names, datas) => {
                                        setSetting({virtualDirectoryIdsSelected:true,virtualDocumentIds: ids, virtualDocumentIdsReplaceData: datas})

                                    }}
                                    layout={document.body}
                                />
                            </Col>
                        </Row>
                    </div>
                    <div style={{'margin-top':'10px'}}>
                        <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@8rual4`} >
                            <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@gum1pq`} span={6} >
                                <Checkbox ecId={`${this && this.props && this.props.ecId || ''}_Checkbox@0j6zik`}
                                    style={{marginLeft: '0px'}}
                                    checked={docIdsSelected}
                                    onChange={e => setSetting({'docIdsSelected':e.target.checked})}
                                >{getLabel(20533, '指定文档')} :</Checkbox>
                            </Col>
                            <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@lnodgq`} span={18}>
                                <WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@412452`}
                                    title={getLabel(386382,"请选择")}
                                    type="37"
                                    replaceDatas={ docIdsReplaceData|| []}
                                    isSingle={false}
                                    onChange={(ids, names, datas) => {
                                        setSetting({docIdsSelected:true,docIds: ids, docIdsReplaceData: datas})

                                    }}
                                    layout={document.body}
                                />
                            </Col>
                        </Row>
                    </div>
                </div>
            </WeaSearchGroup>
        )
    }
}